import time

def get_time(fn):
    def inner():
        start = time.time()
        fn()
        end = time.time()
        print(f'程序执行时长为{end - start}')
    return inner

@get_time
def demo():
    list = []
    for i in range(1000000):
        list.append(i)
demo()